import request from '@/router/axios';
import website from '@/config/website';
import { exportFunc } from "@/api/export";


//获取项目经理任命书详情
export const getDetail = (params) => {
  return request({
    url: '/api/hg-public/projectmanager/detail',
    method: 'get',
    params: {
      ...params,
    }
  })
}

//获取系统用户下拉选
export const getUsers = (params) => {
  return request({
    url: '/api/blade-system/personnelinfo/list',
    method: 'get',
    params: {
      ...params,
    }
  })
}
//保存项目经理
export const saveProjectManagers = (row) => {
  return request({
    url: '/api/hg-public/projectmanager/submit',
    method: 'post',
    data: row
  })
}

//提交
export const submitManager = (managerId) => {
  return request({
    url: '/api/hg-public/projectmanager/start-process',
    method: 'get',
    params: {
      managerId,
    }
  })
}
//导出
export const managerExport = (id, headers) => {
  var strids = 'id=' + id
  exportFunc('/hg-public/projectmanager/exportpdf', headers, strids, '项目经理任命书.pdf')
  // window.location.href = `${website.exportUrl}/hg-public/projectmanager/exportpdf?id=${id}`
}